#ifndef _DPX_H
#define _DPX_H
#include "General.h"

//////////////////////////////////////////////////////////////////////////////
#define RANDCPON    1//(GET_TSYS_SOURCE()!=TG_SRC_ALTER)
#define HARDPARAON    1
/**
#if RANDCPON
    #define HARDPARAON    1
#else
    #define HARDPARAON    0
#endif
*/
///////////////////////////////////////////////////////////////////////////////

/**    Rand  struct \n    
*
*         \n    
*       
*/
typedef struct RandCp
{
    /** corrected trigger point */
    short CpValue;
    /** original trigger point */
    short TpValue;
    /** read trigger value , original not corrected*/
    void (*pReadCpValue)(short);
    /** clear */
    void (*pClearReg)(void);    
}RandCp;

typedef struct _HardPara
{
    short ParallelNum;
} s_HardPara;

extern "C" unsigned short Int_Pre_Trig_FixedOffset;
extern "C" struct RandCp *pgRandCp;
extern "C" s_HardPara *pgHardPara;
extern "C" void InitRandCp(void);

extern "C" void InitHardPara(void);
//extern "C" void CreatRandCp(void);

extern "C" short gPreScanNum;
extern "C" short g_OrigBuf[CH_MAX_CNT+2][MAX_ORIG_BUF_LEN];

extern "C" void DPX_InitADC(void);

extern "C" void DPX_InitFifo(void);

extern "C" void DPX_Acq4Way(short Channel);
extern "C" void DPX_Acq2Way(short discard_num, char type);
extern "C" void DPX_Acq1Way(void);
extern "C" void DPX_AcqSinx(short alterflag);
extern "C" void DPX_AcqSinxDeep(void);
extern "C" void DPX_AcqSinxDeepAlter(short Channel);
extern "C" void DPX_Acq2WayAlter(short Channel,short discard_num);
extern "C" void DPX_Acq1WayDeep(void);

extern "C" void DPX_ReadAgainTest(void);

extern "C" void DPX_AcqOnce(void);

extern "C" void DPX_ConfigMapping(void);
extern "C" void DPX_ConfigPeakMode(void);
extern "C" void DPX_ConfigAverageMode(void);
extern "C" void DPX_ConfigIntensity(unsigned long);

extern "C" void DPX_SuspendMapDPOOutput(short bitFlag,bool bPrepareScreen,bool bImmediateResponse);
extern "C" void DPX_ResumeMapDPOOutput(bool bInitScreen,bool bImmediateResponse);
extern "C" void DPX_MergeScreen(bool Ch1IsDPXWave,bool Ch2IsDPXWave,short *pWaveBuff);

extern "C" short GetTGPoint(short which, short *pBuffer, short Offset, short Stride, short LeftBias, short RightBias,short Interpolated);
//////////////??????????????????
extern "C" unsigned short DPX_AcquireFrameCount;
extern "C" unsigned short MainLoopUsedMs;
extern "C" char dgp_draw_flag;
#endif
